package com.jiyun.controller;

import com.jiyun.feign.PeopleFeign;
import com.jiyun.vo.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title: SquadsController
 * @Author 杜瑞
 * @Date 2023/8/28 19:04
 */
@RestController
@RequestMapping("/squads")
public class SquadsController {
    @Autowired
    private PeopleFeign squadsFeign;
    @Autowired
    private RedisTemplate redisTemplate;
    @RequestMapping("findSquads")
    public ResultResponse findSquads() {
        try {
            ResultResponse squads = squadsFeign.findSquads();
            return ResultResponse.success(squads);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultResponse.error();
        }
    }


    @RequestMapping("bm")
    public ResultResponse bm(String username,String zd,Integer jsId){
        try {
            ResultResponse bm = squadsFeign.bm(username, zd, jsId);
            return ResultResponse.success(bm);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultResponse.error();
        }
    }

    @RequestMapping("findBm")
    public ResultResponse findBm(String username,Integer jsId){
        try {
            ResultResponse bm = squadsFeign.findBm(username,jsId);
            return ResultResponse.success(bm);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultResponse.error();
        }
    }


}
